package com.example.fengshoutong.ui;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.example.fengshoutong.utils.FragmentUtils;

import com.example.fengshoutong.R;

/**
 * 卖货页面
 */
public class SellFragment extends Fragment {

    private Button btnGoHome;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_sell, container, false);
        btnGoHome = view.findViewById(R.id.btn_buy); // 获取"去买货"按钮的引用
        return view;
    }

    @Override
    public void onResume() {
        super.onResume();
        initView();
    }

    private void initView() {
        // 设置"去买货"按钮的点击事件
        btnGoHome.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 假设 R.id.nav_home 是 HomeFragment 对应的 ID
                FragmentUtils.getInstance().switchFragment(R.id.nav_home);
            }
        });
    }
}
//    @Nullable
//    @Override
//    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//        return inflater.inflate(R.layout.fragment_sell, container, false);
//    }
//
//    @Override
//    public void onResume() {
//        super.onResume();
//        initView();
//    }
//
//    private void initView() {
//
//
//    }


